<?php
defined ( 'SYSPATH' ) or die ( 'No direct script access.' );
/********************************************************************************
 * breakphp	=>	框架初始化
 * @copyright 	2012-2013 http://www.breakphp.com,All rights reserved. 			*
 * @link 		http://www.breakphp.com                     				    *
 * @author 		BREAK(306309883@qq.com) 				                        *
 * @date 		2012-07-31			                                            * 
 *******************************************************************************/

header ( "Content-Type:text/html;charset=utf-8" );
date_default_timezone_set ( 'PRC' );
session_start ();

/*
 *-----------------
 * 程序运行环境
 *-----------------
 */
define ( 'ENVIRONMENT', 'dev' );

if (defined ( 'ENVIRONMENT' )) {
	switch (ENVIRONMENT) {
		case 'dev' :
			error_reporting ( E_ALL );
			break;
		case 'online' :
			error_reporting ( 0 );
			break;
		default :
			exit ( '程序运行环境配置参数非法.' );
	}
}

//包含用户配置文件
$config = APPPATH . "config/config.php";
if (file_exists ( $config )) {
	include $config;
}

//包含框架默认helper
$include_path .= PATH_SEPARATOR . SYSPATH . "helpers/common.helper.php";

//自动加载类 	
spl_autoload_register(array('Breakphp', 'auto_load'));

// 载入breakphp核心
require SYSPATH . 'core/breakphp.class.php';

Breakphp::init(array(
	'base_url'   => '/',
));

Breakphp::modules(array(
	// 'auth'       => MODPATH.'auth',       // Basic authentication
	));

Route::set('default', '(<controller>(/<action>(/<id>)))')
	->defaults(array(
		'controller' => 'welcome',
		'action'     => 'index',
	));
?>